/**
 * @file
 * @author dousha 
 * @date 2020/11/29.
 */

#ifndef CRYPTSTICK_BUTTONS_H
#define CRYPTSTICK_BUTTONS_H

#include <stdint.h>

#define BUTTON_NONE 7u
#define BUTTON_LEFT 3u
#define BUTTON_MIDDLE 5u
#define BUTTON_MIDDLE_AND_LEFT 1u
#define BUTTON_LEFT_AND_MIDDLE 1u
#define BUTTON_RIGHT 6u
#define BUTTON_LEFT_AND_RIGHT 2u
#define BUTTON_RIGHT_AND_LEFT 2u
#define BUTTON_RIGHT_AND_MIDDLE 4u
#define BUTTON_MIDDLE_AND_RIGHT 4u
#define BUTTON_ALL 0u

extern void buttons_init(void (*)(uint8_t));

extern void buttons_scan();

extern uint8_t buttons_get_state();

extern uint32_t buttons_get_scan_count();

extern uint8_t buttons_get_immediate_state();

#endif //CRYPTSTICK_BUTTONS_H
